Skip to content

Conversation

@svara
Copy link
Contributor

@svara svara commented Jan 14, 2026

This PR exposes pins API endpoints (pin/unpin and pinned cards list).

Pin
POST /:account_slug/cards/:card_number/pin
Returns: 204 No Content

Unpin
DELETE /:account_slug/cards/:card_number/pin
Returns: 204 No Content

Pinned cards list
GET /my/pins
Returns: an array of card objects (same shape as other card JSON responses).

@svara svara requested a review from jayohms January 15, 2026 16:38
@svara svara marked this pull request as ready for review January 15, 2026 16:38
Copy link
Contributor

@jayohms jayohms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

Comment on lines +10 to +12
Current.user.pins.includes(:card).ordered
else
Current.user.pins.includes(:card).ordered.limit(20)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about moving Current.user.pins.includes(:card).ordered to a variable so it isn't repeated, then conditionally limiting for web requests? This endpoint isn't paginated. Should we limit to 100 like for unread notifications to be safe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants